package com.edu.java.controller;

import com.edu.java.entity.Category;
import com.edu.java.entity.CategoryDTO;
import com.edu.java.entity.CategoryProTemplate;
import com.edu.java.entity.PropDTO;
import com.edu.java.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * TODO
 *
 * @author miaozhiqiang
 * @version 1.0
 * @date 2022/7/16 8:43 下午
 */
@RestController
public class CategoryController {

    @Autowired
    CategoryService categoryService;
    /**
     *
     *
     * @param template
     * 根据商品属性模板，查询出当前类目下的所有属性
     */
    @GetMapping(value = "/goods/categoryProp/type")
    public ResponseEntity<?> getCategoryPropType(@RequestBody CategoryProTemplate template) {
        CategoryDTO categoryType = categoryService.getCategoryPropType(template);
        return ResponseEntity.ok(categoryType);

    }

    @PostMapping(value = "/goods/categoryProp/type")
    public void addCategoryPropType(@RequestBody PropDTO propDTO) {

    }
}
